﻿using System.Data.Entity.ModelConfiguration;
using yiCommerce.Core.Domain.FriendShips;

namespace yiCommerce.Data.Mapping.FriendShips
{
    public class FriendShipGroupMapping: EntityTypeConfiguration<FriendShipGroup>
    {
        public FriendShipGroupMapping()
        {
            this.ToTable("FriendShipGroup");
            this.HasKey(pr => pr.Id);

            HasRequired(c => c.GroupOwner).WithMany(t => t.FriendShipGroups).HasForeignKey(c => c.GroupOwnerId);


            HasMany(c => c.Members);
        }
    }
}